<html>
    <head>
        <script src="../modules.js"></script>
        <script>require('environment.js').setDebug();</script>
    </head>
    <body>
        <script type="text/javascript" language="javascript">
        require('test.js', function (test) { with (test) {
        require('color.js', function (color) { with (color) {
        test.listenReady(function () {

        output(tags('h2', {}, ['Misc']));
        output(inoculate(repr(Color(red))));
        output(Color([0, 1, 1], 1, color.hslMode).html());
        output(Color(red).diff(blue));
        output(Color(red).diff(green));
        output(Color(darkred).diff(yellow));
        output(Color(red).diff(orange));

        output(tags('h2', {}, ['Hue Test']));
        var c = Color("#ff0000ff");
        each(count(0, 360, 30), function (n) {
            c.setHue(n, 360);
            output(c.html());
        });

        output(tags('h2', {}, ['Lightness Test']));
        var c = Color("#ff0000ff");
        each(chain(range(0, 256, 64).reversed(), range(0, 256, 64)), function (n) {
            c.setLightness(n, 256);
            output(c.html());
        });

        output(tags('h2', {}, ['Saturation Test']));
        var c = Color("#ff0000ff");
        c.setLightness(.7);
        each(chain(range(0, 256, 32)), function (n) {
            c.setSaturation(n, 256);
            output(c.html());
        });

        output(tags('h2', {}, ['Mix Test']));
        output(mix('f00', '#0000ff').html());

        var c = Color('777');
        c.mix('red');
        c.mix('green');
        c.mix('blue');
        output(c.html());

        /* This is not a supported form, yet? */
        /*output(mix(red, green, blue));*/

        output(tags('h2', {}, ['Name Test']));
        output(Color(darkorange).html());
        output(Color('darkorange').html());

        output(tags('h2', {}, ['Opacity Test']));
        output(mix('fff0', darkorange).html());


            
        }); /* listen ready */
        }}); /* require with */
        }}); /* require with */
        </script>
    </body>
</html>
